package com.project8.book;

import java.io.Serializable;

public class Bookmark implements Serializable
{	
	private static final long serialVersionUID = -479573377321652298L;

	static long bookmark_id = 0;
	
	long id;
	Page pageBookmarked;
	
	public Bookmark(Page p)
	{
		id = bookmark_id++;
		pageBookmarked = p;
	}
	
	public long getPageNum()
	{
		return pageBookmarked.getPageNum();
	}
	
	public Page getPage()
	{
		return pageBookmarked;
	}
	
	@Override
	public boolean equals(Object o)
	{
		Bookmark anotherBookmark = (Bookmark)o;
		
		if(this.getPageNum() == anotherBookmark.getPageNum())
			return true;
		
		return false;
	}
}
